@using Elsa.Studio.Models
@inherits StudioComponentBase
@inject ILocalizer Localizer

<ScrollableWell MaxHeight="VisiblePaneHeight">
    @if (JournalEntry != null!)
    {
        var record = JournalEntry.Record;
        var payload = ParsePayload(record.Payload);

        var eventInfo = new DataPanelModel
        {
            new DataPanelItem(Localizer["Name"], record.EventName),
            new DataPanelItem(Localizer["Timestamp"], TimeFormatter.Format(record.Timestamp, "s")),
            new DataPanelItem(Localizer["Message"], record.Message)
        };

        Merge(eventInfo, payload);
        
        <MudStack>
            <DataPanel Title="@Localizer["Event"]" Data="eventInfo" HideEmptyValues="true"/>
        </MudStack>
    }
</ScrollableWell>